import React, { PureComponent } from 'react';
import { Modal, List, InputItem, WhiteSpace, Button, WingBlank, Menu, ActivityIndicator, NavBar, TabBar, Card, Flex,Accordion } from 'antd-mobile';
import { connect } from 'dva';
import ast from './index.less';
import md5 from 'md5'
import { setCookie } from '../../utils/auth'
import { createForm, formShape } from 'rc-form';
import { Divider } from 'antd';
const PlaceHolder = ({ className = '', ...restProps }) => (
  <div className={`${className} placeholder`} {...restProps}>Block</div>
);
class ResultTeacherStu extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      initData: '',
      show: false,
      selectedTab: 'redTab',
      hidden: false,
      fullScreen: false
    };
  }
  componentWillMount() {
    this.props.dispatch({ type: "resultTeacherStuModule/loadCultivateTutorStuResu", payload: {
      order:'asc',
      page:1,
      rows:100
    } })
}
  onChange = (value) => {
    let label = '';
  }
  handleClick = (e) => {
    e.preventDefault(); // Fix event propagation on Android
    this.setState({
      show: !this.state.show,
    });
  }

  onMaskClick = () => {
    this.setState({
      show: false,
    });
  }

  render() {
    const { initData, show } = this.state;
    const loadingEl = (
      <div style={{ width: '100%', height: document.documentElement.clientHeight * 0.6, display: 'flex', justifyContent: 'center' }}>
        <ActivityIndicator size="large" />
      </div>
    );
    return (
      <div className={show ? ast.menu_active : ''}>
         <Accordion defaultActiveKey="0" className={ast.my_accordion} onChange={this.onChange}>
                {this.props.studentInfo == undefined ? null :
                      this.props.studentInfo.map((s,key) => {
                        return (<Accordion.Panel key={key} className={ast.Panel} header={
                          <div className={ast.Panel_title}>
                            <img src={require('../../assets/icon_03.png')} style={{ padding: '10px' }} />
                              
                            <p>{s.stuName}</p>
                            <p style={{ margin:'0px 10px;',color:'#747474',marginLeft:'20px' }}>{`${s.grade}级`}</p>
                          </div>
                        }>
                          <ul>
                            <li>{`学号：${s.stuNum}`}</li>
                            <li>{`学生类型：${s.stuTypeCode  == "01" ? '全日制专业学位硕士': s.stuTypeCode  == "02" ?'全日制学术型硕士': s.stuTypeCode  == "05" ? '全日制专业学位博士': s.stuTypeCode == "03" ? '全日制学术型博士' : s.stuTypeCode == "06" ? '同等学力硕士' : s.stuTypeCode == "11" ? '全日制学术型硕士留学生' : s.stuTypeCode == "10" ? '全日制专业学位硕士留学生' : s.stuTypeCode == "13" ? '全日制学术型博士留学生' : s.stuTypeCode == "12" ? '全日制专业学位博士留学生' : s.stuTypeCode == "09" ? '非全日制学术型硕士' : s.stuTypeCode == "08" ? '非全日制专业学位硕士' : s.stuTypeCode}`}</li>
  
                          </ul>
                        </Accordion.Panel>)
                      })
                    }
        
        </Accordion>
        
      </div>
    );
  }
}
function mapStateToProps(state) {
  return {
    studentInfo: state.resultTeacherStuModule.loadStuInfoList.rows
    // loadStuInfoList:state.login.loadStuInfoList

  }
}
export default connect(mapStateToProps)(ResultTeacherStu);
